package com.ruoyi.information.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.information.mapper.InventorySupplierMapper;
import com.ruoyi.information.domain.InventorySupplier;
import com.ruoyi.information.service.IInventorySupplierService;
import com.ruoyi.common.core.text.Convert;

/**
 * 供应商信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-17
 */
@Service
public class InventorySupplierServiceImpl implements IInventorySupplierService 
{
    @Autowired
    private InventorySupplierMapper inventorySupplierMapper;

    /**
     * 查询供应商信息
     * 
     * @param supplierId 供应商信息主键
     * @return 供应商信息
     */
    @Override
    public InventorySupplier selectInventorySupplierBySupplierId(String supplierId)
    {
        return inventorySupplierMapper.selectInventorySupplierBySupplierId(supplierId);
    }

    /**
     * 查询供应商信息列表
     * 
     * @param inventorySupplier 供应商信息
     * @return 供应商信息
     */
    @Override
    public List<InventorySupplier> selectInventorySupplierList(InventorySupplier inventorySupplier)
    {
        return inventorySupplierMapper.selectInventorySupplierList(inventorySupplier);
    }

    /**
     * 新增供应商信息
     * 
     * @param inventorySupplier 供应商信息
     * @return 结果
     */
    @Override
    public int insertInventorySupplier(InventorySupplier inventorySupplier)
    {
        inventorySupplier.setCreateTime(DateUtils.getNowDate());
        return inventorySupplierMapper.insertInventorySupplier(inventorySupplier);
    }

    /**
     * 修改供应商信息
     * 
     * @param inventorySupplier 供应商信息
     * @return 结果
     */
    @Override
    public int updateInventorySupplier(InventorySupplier inventorySupplier)
    {
        inventorySupplier.setUpdateTime(DateUtils.getNowDate());
        return inventorySupplierMapper.updateInventorySupplier(inventorySupplier);
    }

    /**
     * 批量删除供应商信息
     * 
     * @param supplierIds 需要删除的供应商信息主键
     * @return 结果
     */
    @Override
    public int deleteInventorySupplierBySupplierIds(String supplierIds)
    {
        return inventorySupplierMapper.deleteInventorySupplierBySupplierIds(Convert.toStrArray(supplierIds));
    }

    /**
     * 删除供应商信息信息
     * 
     * @param supplierId 供应商信息主键
     * @return 结果
     */
    @Override
    public int deleteInventorySupplierBySupplierId(String supplierId)
    {
        return inventorySupplierMapper.deleteInventorySupplierBySupplierId(supplierId);
    }
}
